home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 002a / be310.zip / COMPILE.CHS < prev    next >
Text File  |  1993-06-01  |  2KB  |  73 lines

  1. /* CHESS FUNCTION(S): COMPILE.CHS -- standalone Chess program file
  2. /*              DATE: 3/1/93
  3. /*            AUTHOR: C. Schanck
  4. /*
  5. /*       DESCRIPTION: This program file contains a main body
  6. /* which offers some compile choices (Reconfigure to your
  7. /* tastes).  Compile choices rely on the function
  8. /* 'compile_review' which executes the given command line and, if
  9. /* the error file name is not blank, calls the function
  10. /* 'parse_errs' to parse any errors associated with it.
  11. /* 
  12. /* attach this to a key via
  13. /*    f1    run("c:\edit\bingo\compile.chs);
  14. /* or bring it into the bingo.cfg directly
  15. {           
  16.    char temp[80];
  17.    char buf[80];
  18.    int i;
  19.    i=box_pick("Which Compile Choice?",3,0,"1. Make","2. Compile Current File");
  20.    if(i==0)
  21.       return(compile_review("make > errs","errs."));
  22.    if(i==1)
  23.    {             
  24.       ask("file_path",temp);
  25.       ask("file_name",temp+strlen(temp));
  26.       sformat(buf,"tcc %s > errs",temp);
  27.       return(compile_review(buf,"errs."));
  28.    }
  29.    return(0);
  30. }
  31. compile_review       /* this runs a command, then if the errname
  32. char cmd[0]          /* is not empty, parses the error file
  33. char errname[0]
  34. {       
  35.    int ret;
  36.               
  37.    if(cmd[0]==0)
  38.       return(0);
  39.       
  40.    if(Modify_save_all())
  41.    {         
  42.       str(cmd);
  43.       key("return");
  44.       key("return");
  45.       ret=Swap_execute(); /* compile it 
  46.       if(errname[0]!=0)
  47.          ret=parse_errs(errname);
  48.    }         
  49.    return(ret);
  50. }
  51. parse_errs        /* this parses the error file passed in
  52. char errname[0];
  53. {  
  54.    int i;                                       
  55.    set_display(0);
  56.    
  57.    Window_one();                    /* one window
  58.    Window_split();                  /* split window 
  59.    Load_file(errname);                 /* load file 
  60.    Window_previous();
  61.    Window_max();
  62.    
  63.    key("up_arrow");
  64.    key("up_arrow");
  65.    key("return");
  66.    Window_resize();
  67.    Setup_err_parse(errname);
  68.  
  69.    set_display(1);
  70.    update_display();
  71.  
  72.    return(Next_error());
  73. }